// custom-tab-bar/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    selected:0,
    color:'#7a7e83',
    selectedColor:'#3cc51f',
    list:[{
      pagePath:"/pages/tabbar/index1",
      iconPath:"/images/tabbar/component.png",
      selectedIconPath:"/images/tabbar/component-on.png",
      text:"index",
      iconClass:'icon-homefill'
    },
    {
      pagePath:"/pages/tabbar/index2",
      iconPath:"/images/tabbar/component.png",
      selectedIconPath:"/images/tabbar/component-on.png",
      text:"index",
      iconClass:'cu-btn icon-add bg-green shadow',
      iconTopClass:'add-action'
    },
    {
      pagePath:"/pages/tabbar/index3",
      iconPath:"/images/tabbar/component.png",
      selectedIconPath:"/images/tabbar/component-on.png",
      text:"自定义",
      iconClass:'icon-my',
      iconTopClass:''
    }]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e){
      const data = e.currentTarget.dataset;
      const url = data.path;
      wx.switchTab({
        url: url,
      })
      this.setData({
        selected:data.index
      })
    }
  }
})
